package org.testis.gui.mvc.model.dynamicmap;

import org.testis.gui.mvc.model.*;
import org.testis.gui.mvc.controller.dynamicmap.DynamicMapPopupController;
import java.util.LinkedList;

import org.testis.orm.refinedclasses.DynamicMapDesignTreeNode;

/**
 *
 * @author Cahit Emir Erel
 */
public class DynamicMapPopupModel extends AbstractModel {

    private String m_pasteLabel = "Paste";
    private Boolean m_dynamicMapPasteVisibility = false;
    private Boolean m_dynamicMapCloneVisibility = false;
    private Boolean m_dynamicMapCopyVisibility = false;
    private Boolean m_dynamicMapEditVisibility = false;
    private Boolean m_dynamicMapDeleteVisibility = false;
    private Boolean m_dynamicMapBehaviourVisibility = false;
    private Boolean m_dynamicMapObjectVisibility = false;
    private Boolean m_dynamicMapCloseTreeVisibility = false;
    private Boolean m_dynamicMapObjectGroupVisibility = false;
    private Boolean m_dynamicMapContainerVisibility = false;
    private Boolean m_dynamicMap1To1CopyVisibility = false;
    private Boolean m_dynamicMapCopySuiteAttributesVisibility = false;
    private Boolean m_dynamicMapSearchAbstractIdVisibility = false;
    private Boolean m_dynamicMapValidationVisibility = false;
    private DynamicMapDesignTreeNode m_clonedObject = null;

    public void setDynamicMapCopySuiteAttributesVisibility(Boolean visibility) {
        if (visibility == null) {
            return;
        }
        Boolean oldVisibility =
                m_dynamicMapCopySuiteAttributesVisibility;
        m_dynamicMapCopySuiteAttributesVisibility = visibility;
        firePropertyChange(
                DynamicMapPopupController.SET_POPUP_MENU_COPY_SUITE_ATTRIBUTES_VISIBILITY,
                oldVisibility,
                visibility);
    }

    public Boolean getDynamicMapCopySuiteAttributesVisibility() {
        return m_dynamicMapCopySuiteAttributesVisibility;
    }

    public void setDynamicMap1To1CopyVisibility(
            Boolean dynamicMap1To1CopyVisibility) {
        if (dynamicMap1To1CopyVisibility == null) {
            return;
        }
        Boolean oldDynamicMap1To1CopyVisibility =
                m_dynamicMap1To1CopyVisibility;
        m_dynamicMap1To1CopyVisibility = dynamicMap1To1CopyVisibility;
        firePropertyChange(
                DynamicMapPopupController.SET_POPUP_MENU_1_TO_1_COPY_VISIBILITY,
                oldDynamicMap1To1CopyVisibility,
                dynamicMap1To1CopyVisibility);
    }

    public Boolean getDynamicMap1To1CopyVisibility() {
        return m_dynamicMap1To1CopyVisibility;
    }

    public void setDynamicMapContainerVisibility(
            Boolean dynamicMapContainerVisibility) {
        if (dynamicMapContainerVisibility == null) {
            return;
        }
        Boolean oldDynamicMapContainerVisibility =
                m_dynamicMapContainerVisibility;
        m_dynamicMapContainerVisibility = dynamicMapContainerVisibility;
        firePropertyChange(
                DynamicMapPopupController.SET_POPUP_MENU_CONTAINER_VISIBILITY,
                oldDynamicMapContainerVisibility,
                dynamicMapContainerVisibility);
    }

    public Boolean getDynamicMapContainerVisibility() {
        return m_dynamicMapContainerVisibility;
    }

    public void setDynamicMapObjectGroupVisibility(
            Boolean dynamicMapObjectGroupVisibility) {
        if (dynamicMapObjectGroupVisibility == null) {
            return;
        }
        Boolean oldDynamicMapObjectGroupVisibility =
                m_dynamicMapObjectGroupVisibility;
        m_dynamicMapObjectGroupVisibility = dynamicMapObjectGroupVisibility;
        firePropertyChange(
                DynamicMapPopupController.SET_POPUP_MENU_OBJECT_GROUP_VISIBILITY,
                oldDynamicMapObjectGroupVisibility,
                dynamicMapObjectGroupVisibility);
    }

    public Boolean getDynamicMapObjectGroupVisibility() {
        return m_dynamicMapObjectGroupVisibility;
    }

    public void setDynamicMapPasteLabel(String label) {
        if (label == null) {
            label = "";
        }
        String oldLabel = m_pasteLabel;
        m_pasteLabel = label;
        firePropertyChange(DynamicMapPopupController.CHANGE_PASTE_LABEL,
                oldLabel,
                label);
    }

    public String getDynamicMapPasteLabel() {
        return m_pasteLabel;
    }

    public void setDynamicMapObjectVisibility(Boolean dynamicMapObjectVisibility) {
        if (dynamicMapObjectVisibility == null) {
            return;
        }
        Boolean oldDynamicMapObjectVisibility = m_dynamicMapObjectVisibility;
        m_dynamicMapObjectVisibility = dynamicMapObjectVisibility;
        firePropertyChange(
                DynamicMapPopupController.SET_POPUP_MENU_OBJECT_VISIBILITY,
                oldDynamicMapObjectVisibility,
                dynamicMapObjectVisibility);
    }

    public Boolean getDynamicMapObjectVisibility() {
        return m_dynamicMapObjectVisibility;
    }

    public void setDynamicMapBehaviourVisibility(
            Boolean dynamicMapBehaviourVisibility) {
        if (dynamicMapBehaviourVisibility == null) {
            return;
        }
        Boolean oldDynamicMapBehaviourVisibility =
                m_dynamicMapBehaviourVisibility;
        m_dynamicMapBehaviourVisibility = dynamicMapBehaviourVisibility;
        firePropertyChange(
                DynamicMapPopupController.SET_POPUP_MENU_BEHAVIOUR_VISIBILITY,
                oldDynamicMapBehaviourVisibility,
                dynamicMapBehaviourVisibility);
    }

    public Boolean getDynamicMapBehaviourVisibility() {
        return m_dynamicMapBehaviourVisibility;
    }

    public void setDynamicMapDeleteVisibility(Boolean dynamicMapDeleteVisibility) {
        if (dynamicMapDeleteVisibility == null) {
            return;
        }
        Boolean oldDynamicMapDeleteVisibility = m_dynamicMapDeleteVisibility;
        m_dynamicMapDeleteVisibility = dynamicMapDeleteVisibility;
        firePropertyChange(
                DynamicMapPopupController.SET_POPUP_MENU_DELETE_VISIBILITY,
                oldDynamicMapDeleteVisibility,
                dynamicMapDeleteVisibility);
    }

    public Boolean getDynamicMapDeleteVisibility() {
        return m_dynamicMapDeleteVisibility;
    }

    public void setDynamicMapEditVisibility(Boolean dynamicMapEditVisibility) {
        if (dynamicMapEditVisibility == null) {
            return;
        }
        Boolean oldDynamicMapEditVisibility = m_dynamicMapEditVisibility;
        m_dynamicMapEditVisibility = dynamicMapEditVisibility;
        firePropertyChange(
                DynamicMapPopupController.SET_POPUP_MENU_EDIT_VISIBILITY,
                oldDynamicMapEditVisibility,
                dynamicMapEditVisibility);
    }

    public Boolean getDynamicMapEditVisibility() {
        return m_dynamicMapEditVisibility;
    }

    public void setDynamicMapCloneVisibility(Boolean dynamicMapCloneVisibility) {
        if (dynamicMapCloneVisibility == null) {
            return;
        }
        Boolean oldDynamicMapCloneVisibility = m_dynamicMapCloneVisibility;
        m_dynamicMapCloneVisibility = dynamicMapCloneVisibility;
        firePropertyChange(
                DynamicMapPopupController.SET_POPUP_MENU_CLONE_VISIBILITY,
                oldDynamicMapCloneVisibility,
                dynamicMapCloneVisibility);
    }

    public Boolean getDynamicMapCloneVisibility() {
        return m_dynamicMapCloneVisibility;
    }

    public void setDynamicMapCopyVisibility(Boolean dynamicMapCopyVisibility) {
        if (dynamicMapCopyVisibility == null) {
            return;
        }
        Boolean oldDynamicMapCopyVisibility = m_dynamicMapCopyVisibility;
        m_dynamicMapCopyVisibility = dynamicMapCopyVisibility;
        firePropertyChange(
                DynamicMapPopupController.SET_POPUP_MENU_COPY_VISIBILITY,
                oldDynamicMapCopyVisibility,
                dynamicMapCopyVisibility);
    }

    public Boolean getDynamicMapCopyVisibility() {
        return m_dynamicMapCopyVisibility;
    }

    public void setDynamicMapPasteVisibility(
            Boolean dynamicMapPasteCloneVisibility) {
        if (dynamicMapPasteCloneVisibility == null) {
            return;
        }
        Boolean oldDynamicMapPasteCloneVisibility =
                m_dynamicMapPasteVisibility;
        m_dynamicMapPasteVisibility = dynamicMapPasteCloneVisibility;
        firePropertyChange(
                DynamicMapPopupController.SET_POPUP_MENU_PASTE_CLONE_VISIBILITY,
                oldDynamicMapPasteCloneVisibility,
                dynamicMapPasteCloneVisibility);
    }

    public Boolean getDynamicMapPasteVisibility() {
        return m_dynamicMapPasteVisibility;
    }

    public void setDynamicMapCloseTreeVisibility(
            Boolean dynamicMapCloseTreeVisibility) {
        if (dynamicMapCloseTreeVisibility == null) {
            return;
        }
        Boolean oldDynamicMapCloseTreeVisibility =
                m_dynamicMapCloseTreeVisibility;
        m_dynamicMapCloseTreeVisibility = dynamicMapCloseTreeVisibility;
        firePropertyChange(
                DynamicMapPopupController.SET_POPUP_MENU_CLOSE_TREE_VISIBILITY,
                oldDynamicMapCloseTreeVisibility,
                dynamicMapCloseTreeVisibility);
    }

    public Boolean getDynamicMapCloseTreeVisibility() {
        return m_dynamicMapCloseTreeVisibility;
    }

    public void setOpenDynamicMapMenu(LinkedList coordinates) {
        if (coordinates != null && coordinates.size() == 3) {
            firePropertyChange(DynamicMapPopupController.OPEN_POPUP_MENU,
                    null,
                    coordinates);
        }
    }

    public void setClonedObject(DynamicMapDesignTreeNode clonedObject) {
        DynamicMapDesignTreeNode oldClonedObject = m_clonedObject;
        m_clonedObject = clonedObject;
        firePropertyChange(DynamicMapPopupController.NODE,
                oldClonedObject,
                clonedObject);
    }

    public DynamicMapDesignTreeNode getClonedObject() {
        return m_clonedObject;
    }

    /**
     * @return the m_dynamicMapSearchAbstractIdVisibility
     */
    public Boolean getDynamicMapSearchAbstractIdVisibility() {
        return m_dynamicMapSearchAbstractIdVisibility;
    }

    /**
     * @param m_dynamicMapSearchAbstractIdVisibility the m_dynamicMapSearchAbstractIdVisibility to set
     */
    public void setDynamicMapSearchAbstractIdVisibility(Boolean dynamicMapSearchAbstractIdVisibility) {

        if (dynamicMapSearchAbstractIdVisibility == null) {
            return;
        }
        Boolean oldDynamicMapSearchAbstractIdVisibility =
                m_dynamicMapSearchAbstractIdVisibility;
        m_dynamicMapSearchAbstractIdVisibility = dynamicMapSearchAbstractIdVisibility;
        firePropertyChange(
                DynamicMapPopupController.SET_POPUP_MENU_SEARCH_ABSID_TREE_VISIBILITY,
                oldDynamicMapSearchAbstractIdVisibility,
                dynamicMapSearchAbstractIdVisibility);
    }

    /**
     * @return the m_dynamicMapValidationVisibility
     */
    public Boolean getDynamicMapValidationVisibility() {
        return m_dynamicMapValidationVisibility;
    }

    /**
     * @param m_dynamicMapValidationVisibility the m_dynamicMapValidationVisibility to set
     */
    public void setDynamicMapValidationVisibility(Boolean dynamicMapValidationVisibility) {
        if (dynamicMapValidationVisibility == null) {
            return;
        }
        Boolean oldDynamicMapValidationVisibility =
                m_dynamicMapValidationVisibility;
        m_dynamicMapValidationVisibility = dynamicMapValidationVisibility;
        firePropertyChange(
                DynamicMapPopupController.SET_POPUP_MENU_VALIDATE_TREE_VISIBILITY,
                oldDynamicMapValidationVisibility,
                m_dynamicMapValidationVisibility);
    }
}
    

